<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
<head>
  <link href="//gmpg.org/xfn/11" rel="profile">
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta name="generator" content="Hugo 0.68.3" />

  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>商品检索同一页面无法跳转 &middot; wangxin</title>

  
  <link type="text/css" rel="stylesheet" href="/my_technology_blog/css/print.css" media="print">
  <link type="text/css" rel="stylesheet" href="/my_technology_blog/css/poole.css">
  <link type="text/css" rel="stylesheet" href="/my_technology_blog/css/syntax.css">
  <link type="text/css" rel="stylesheet" href="/my_technology_blog/css/hyde.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Abril+Fatface|PT+Sans:400,400i,700">


  
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144-precomposed.png">
  <link rel="shortcut icon" href="/favicon.png">

  
  
</head>

  <body class="theme-base-0d ">
  <aside class="sidebar">
  <div class="container sidebar-sticky">
    <div class="sidebar-about">
      <a href="/my_technology_blog/"><h1>wangxin</h1></a>
      <p class="lead">
       努力到拼尽全力，拼搏到感动自己 
      </p>
    </div>

    <nav>
      <ul class="sidebar-nav">
        <li><a href="/my_technology_blog//three">作者简介</a> </li>
        
      </ul>
    </nav>

    <p>&copy; 2020. All rights reserved. </p>
  </div>
</aside>

    <main class="content container">
    <div class="post">
  <h1>商品检索同一页面无法跳转</h1>
  <time datetime=2020-04-09T00:00:00Z class="post-date">Thu, Apr 9, 2020</time>
  <h3 id="方案一">方案一</h3>
<blockquote>
<p>监听route是否更新，如果更新刷新当前网页</p>
</blockquote>
<pre><code>    watch:{
        $route(to,from){
        this.$router.go(0)
        }
    }
</code></pre><h3 id="方案二">方案二</h3>
<blockquote>
<p>如上同理监听route是否更新，如果更新获取参数，重新提交请求</p>
</blockquote>
<pre><code>    //监听检索指
     $route:{

        handler(o,n){

        this.word = this.$route.query.word

        this.get_goods()
    },
    //首次绑定是否执行 true只要声明就执行，flase参数发生改变才执行
    immediate:true
    }
</code></pre>
</div>


    </main>

    
  </body>
</html>
